import request from '@/utils/request.js';

// 根据id获取所有的评论
export const commentListAllService = (id) => {
    return request.get('/comment?id='+id);
}

// 新增评论
export const addCommentService = (commentData) => {
    return request.post('/comment', commentData, 
        {
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        }
    );
}

// 删除评论
export const deleteCommentService = (commentId) => {
    return request.delete('/comment?id='+commentId);
}